<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.util.*" import="com.happypets.model.PetBean"
	import="com.happypets.model.UserBean"%>
<%
	String path = request.getContextPath() + "/web";
%>
<!DOCTYPE html>
<html>
<head>
<title>happy pets</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css"
	media="all">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
<script src="js/bootstrap.min.js"></script>
<!-- Custom Theme files -->
<!--theme-style-->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all">
<!--//theme-style-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="keywords" content="feng design" />
<script type="application/x-javascript">
	
	
	 addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } 


</script>
<script type="text/javascript" src="<%=path%>/js/move-top.js"></script>
<script type="text/javascript" src="<%=path%>/js/easing.js"></script>
<script type="text/javascript" src="js/cart.js"></script>
<script type="text/javascript" src="js/updateInfo.js"></script>
<script type="text/javascript" src="js/comm-deal.js"></script>
<script type="text/javascript">
	jQuery(document).ready(function($) {
		$(".scroll").click(function(event) {
			event.preventDefault();
			$('html,body').animate({
				scrollTop : $(this.hash).offset().top
			}, 1000);
		});
	});
</script>






<!-- start menu -->


</script>
<link href="<%=path%>/css/memenu.css" rel="stylesheet" type="text/css"
	media="all" />
<script type="text/javascript" src="<%=path%>/js/memenu.js"></script>
<script>
	$(document).ready(function() {
		$(".memenu").memenu();
	});
</script>
</head>
<body>

	<%
		//移除indexFlag使下一次进入主页仍首先通过servlet
		//session.removeAttribute("indexFlag");
	%>







	<!-- 复制头部部分 -->
	<!--top-header-->
	<div class="top-header">
		<div class="container">
			<div class="top-header-main">
				<div class="col-md-4 top-header-left">
					<div class="search-bar">
						<!-- --------search-----no---- -->
						<input type="text" id="keywordSearch" value="搜索"
							onfocus="this.value = '';"
							onblur="if (this.value == '') {this.value = '搜索';}"> <input
							type="submit" value="" onclick="keywordSearch()">
						<!-- --------end------------ -->
					</div>
				</div>
				<div class="col-md-4 top-header-middle">
					<a href="index.jsp"><img src="../images/logo.png" alt="" /></a>
				</div>
				<div class="col-md-4 top-header-right">
					<div class="cart box_1">


						<!-- --------------------------------------购物车与登录部分----------------------no--------------------------- -->
						<p>

							<%
								UserBean user = (UserBean) session.getAttribute("user");
								String userId = "0";
								if (user == null) {
							%>
							<span id="login_in" class=" btn-lg" data-toggle="modal"
								data-target="#loginModal">登录</span>/ <span id="regist"
								class=" btn-lg" data-toggle="modal" data-target="#registModal">注册</span>
							<span> <%
 	} else {
 %> <a href="userInfo.jsp" class="btn"><span> <%=user.getUserName()%>
								</span></a><span class=" btn" id="exit-btn">退出</span> <%
 	userId = user.getUserId();
 	}
 %> <a href="checkout.jsp">
									<h3>
										<div class="total">

											<span class="simpleCart_total"></span> (<span
												id="simpleCart_quantity" class="simpleCart_quantity"></span>
											爱宠)

										</div>
									</h3> <img src="../images/cart-1.png" alt="" />
							</a></span>
						</p>


						<p>
							<a href="javascript:;" class="simpleCart_empty">空购物车</a>
						</p>

						<script type="text/javascript">
							//初始化购物车
							cart_add(1, 1, 3, 1, 0);
						</script>

						<!-- ----------------------------------订单，购物车，结算------------------end----------------------------------------------------->

						<div class="clearfix"></div>
					</div>
				</div>
				<div class="clearfix"></div>
			</div>
		</div>
	</div>
	<!--top-header-->
	<!--bottom-header-->
	<div class="header-bottom">
		<div class="container">
			<div class="top-nav">
				<ul class="memenu skyblue">
					<li class="active"><a href="index.jsp">主页</a></li>
					<li class="grid"><a href="dogs.jsp?kind=1">狗狗</a>
						<div class="mepanel">
							<div class="row">
								<div class="col1 me-one">
									<h4>大型犬</h4>
									<ul>
										<!--从数据库中读取前8条狗类图片-->
										<!-- 直接读取耗时，为了能修改还是建议从数据库中读取 -->
										<!-- 再次思考认为直接写死，后台修改 -->
										<!--  页面跳转到servlet-->
										<li><a href="products.html">藏獒</a></li>
										<li><a href="products.html">卡斯罗</a></li>
										<li><a href="products.html">罗威纳犬</a></li>
										<li><a href="products.html">阿拉斯加雪橇犬</a></li>
										<li><a href="products.html">法老王猎犬</a></li>
										<li><a href="dogs.jsp?kind=1">更多</a></li>
									</ul>
								</div>
								<div class="col1 me-one">
									<h4>中型犬</h4>
									<ul>
										<li><a href="products.html">斑点狗</a></li>
										<li><a href="products.html">杜宾犬</a></li>
										<li><a href="products.html">哈士奇</a></li>
										<li><a href="products.html">灵缇</a></li>
										<li><a href="dogs.jsp?kind=1.jsp">更多</a></li>
									</ul>
								</div>
								<div class="col1 me-one">
									<h4>小型犬</h4>
									<ul>
										<li><a href="products.html">吉娃娃</a></li>
										<li><a href="products.html">蝴蝶犬</a></li>
										<li><a href="products.html">北京犬</a></li>
										<li><a href="products.html">苏格兰梗</a></li>
										<li><a href="products.html">比格猎犬</a></li>
										<li><a href="products.html">拉萨犬</a></li>
										<li><a href="dogs.jsp">更多</a></li>
									</ul>
								</div>
							</div>
						</div></li>
					<li class="grid"><a href="dogs.jsp?kind=2">猫咪</a>
						<div class="mepanel">
							<div class="row">
								<div class="col1 me-one">
									<h4>长毛猫</h4>
									<ul>
										<li><a href="products.html">波斯猫</a></li>
										<li><a href="products.html">布偶猫</a></li>
										<li><a href="products.html">伯曼猫</a></li>
										<li><a href="products.html">索马里猫</a></li>
										<li><a href="products.html">巴厘猫</a></li>
										<li><a href="dogs.jsp?kind=2">更多</a></li>
									</ul>
								</div>
								<div class="col1 me-one">
									<h4>短毛猫</h4>
									<ul>
										<li><a href="products.html">中国狸花猫</a></li>
										<li><a href="products.html">埃及猫</a></li>
										<li><a href="products.html">俄罗斯蓝猫</a></li>
										<li><a href="products.html">孟买猫</a></li>
										<li><a href="dogs.jsp?kind=2">更多</a></li>
									</ul>
								</div>
								<div class="col1 me-one">
									<h4>无毛猫</h4>
									<ul>
										<li><a href="products.html">斯芬克斯猫</a></li>
										<li><a href="products.html">加拿大无毛猫</a></li>
										<li><a href="dogs.jsp?kind=2">更多</a></li>
									</ul>
								</div>
							</div>
						</div></li>
					<li class="grid"><a href="single.html">鸟类</a>
						<div class="mepanel">
							<div class="row">
								<div class="col1 me-one">
									<h4>鸣禽</h4>
									<ul>
										<li><a href="products.html">New Arrivals</a></li>
										<li><a href="products.html">Men</a></li>
										<li><a href="products.html">Women</a></li>
										<li><a href="products.html">Accessories</a></li>
										<li><a href="products.html">Kids</a></li>
										<li><a href="products.html">login</a></li>
										<li><a href="products.html">Brands</a></li>
										<li><a href="products.html">更多</a></li>
									</ul>
								</div>
								<div class="col1 me-one">
									<h4>宠物鸟</h4>
									<ul>
										<li><a href="products.html">Men</a></li>
										<li><a href="products.html">Women</a></li>
										<li><a href="products.html">Brands</a></li>
										<li><a href="products.html">Kids</a></li>
										<li><a href="products.html">Accessories</a></li>
										<li><a href="products.html">更多</a></li>
									</ul>
								</div>
								<div class="col1 me-one">
									<h4>观赏鸟</h4>
									<ul>
										<li><a href="products.html">Levis</a></li>
										<li><a href="products.html">Persol</a></li>
										<li><a href="products.html">Nike</a></li>
										<li><a href="products.html">Edwin</a></li>
										<li><a href="products.html">New Balance</a></li>
										<li><a href="products.html">Jack & Jones</a></li>
										<li><a href="products.html">Paul Smith</a></li>
										<li><a href="products.html">Ray-Ban</a></li>
										<li><a href="products.html">更多</a></li>
									</ul>
								</div>
							</div>
						</div></li>
					<li class="grid"><a href="dogs.html">其它</a>
						<div class="mepanel">
							<div class="row">
								<div class="col1 me-one">
									<h4>昆虫</h4>
									<ul>
										<li><a href="products.html">蜘蛛</a></li>
										<li><a href="products.html">螳螂</a></li>
										<li><a href="products.html">蝎子</a></li>
										<li><a href="products.html">蜗牛</a></li>
										<li><a href="products.html">蚯蚓</a></li>
										<li><a href="products.html">蜥蜴</a></li>
										<li><a href="products.html">龙虾</a></li>
										<li><a href="products.html">更多</a></li>
									</ul>
								</div>
								<div class="col1 me-one">
									<h4>鱼类</h4>
									<ul>
										<li><a href="products.html">青鱼</a></li>
										<li><a href="products.html">草鱼</a></li>
										<li><a href="products.html">金鱼</a></li>
										<li><a href="products.html">中华鲟</a></li>
										<li><a href="products.html">扬子鳄</a></li>
										<li><a href="products.html">更多</a></li>
									</ul>
								</div>
								<div class="col1 me-one">
									<h4>奇葩宠物</h4>
									<ul>
										<li><a href="products.html">蟒蛇</a></li>
										<li><a href="products.html">剑齿虎</a></li>
										<li><a href="products.html">长颈鹿</a></li>
										<li><a href="products.html">狮子</a></li>
										<li><a href="products.html">蓝鲸</a></li>
										<li><a href="products.html">企稳</a></li>
										<li><a href="products.html">普氏野马</a></li>
										<li><a href="products.html">黑曼巴</a></li>
										<li><a href="products.html">更多</a></li>
									</ul>
								</div>
							</div>
						</div></li>
				</ul>
			</div>
			<div class="clearfix"></div>
		</div>
	</div>
	<!--bottom-header-->
	<!-- 复制部分结束 -->


	<!-- 个人信息部分 -->
	<div class="shoes">
		<div class="container">
			<ul id="myTab" class="nav nav-tabs">
				<li class="active"><a href="#home" data-toggle="tab">个人信息</a></li>
				<li id="shopInfoUrl"><a href="#ios" data-toggle="tab">购物记录</a></li>
				<li id="willDoUrl"><a href="#wp" data-toggle="tab">待处理事务</a></li>
			</ul>
			<div id="myTabContent" class="tab-content">
				<div class="tab-pane fade in active" id="home">
					<!-- userInfo -->
					<br>
					<button class="btn" id="userInfoBtn">基本资料</button>
					&nbsp;&nbsp;&nbsp;&nbsp;
					<button class="btn" id="userPhotoBtn">头像信息</button>
					<br>
					<hr>
					<br>
					<h1 align="center">
						亲爱的<%=user.getUserName()%>请填写真实的资料，方便你的购物。
					</h1>
					<div class="partInfo">
						<form class="form-horizontal" role="form" id="userInfoForm">
							<div class="form-group">
								<label for="firstname" class="col-sm-2 control-label">*用户名</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="r_userName"
										value="<%=user.getUserName()%>"> <span
										class="r_nameWaring" style="display: none; color: #ff0000">请输入用户名</span>
								</div>
							</div>
							<!-- passwd -->
							<div class="form-group">
								<label for="lastname" class="col-sm-2 control-label">密&nbsp;&nbsp;&nbsp;&nbsp;码</label>
								<div class="col-sm-10">
									<input type="password" class="form-control" id="r_passwd"
										value="<%=user.getPassword()%>"> <span
										class="r_passwdWaring" style="display: none; color: #ff0000">密码不符合规范</span>
								</div>
							</div>

							<!-- realName -->
							<div class="form-group">
								<label for="firstname" class="col-sm-2 control-label">*真实姓名</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="r_realName"
										value="<%=user.getUserRealName()%>"> <span
										class="r_realNameWaring" style="display: none; color: #ff0000">请输入真实姓名</span>
								</div>
							</div>

							<!-- sex -->
							<div class="form-group">
								<label for="lastname" class="col-sm-2 control-label">*性别</label>
								<div class="input-group" id="r_sex">



									<%
										if (user.getUserSex() == "man" || user.getUserSex().equals("man")) {
									%>
									<span class="input-group-addon"> <input type="radio"
										checked="checked" value="man" name="sex">男
									</span> <span class="input-group-addon"> <input type="radio"
										value="women" name="sex">女
									</span>
									<%
										} else {
									%>
									<span class="input-group-addon"> <input type="radio"
										value="man" name="sex">男
									</span> <span class="input-group-addon"> <input type="radio"
										checked="checked" value="women" name="sex">女
									</span>
									<%
										}
									%>

								</div>
							</div>

							<!--bir -->
							<%
								String bir = user.getUserBir();
								String year = "2015";
								String day = "01";
								String month = "01";
								try{
								year = bir.substring(0, bir.indexOf("-"));
								month = bir.substring(bir.indexOf("-") + 1, bir.lastIndexOf("-"));
								day = bir.substring(bir.lastIndexOf("-") + 1, bir.lastIndexOf(" "));
								}catch(Exception e){
									
								}
							%>
							<div class="form-group">
								<label for="firstname" class="col-sm-2 control-label">*出生日期</label>
								<div class="col-sm-10">
									<select class="r_bir_year">
										<option><%=year%></option>
									</select> <select class="r_bir_month">
										<option><%=month%></option>
									</select> <select class="r_bir_day">
										<option><%=day%></option>
									</select>
								</div>
							</div>

							<!-- phone -->
							<div class="form-group">
								<label for="firstname" class="col-sm-2 control-label">*手机号</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="r_phone"
										value="<%=user.getUserPhone()%>"> <span
										class="r_phoneWaring" style="display: none; color: #ff0000">请输入正确的手机号</span>
								</div>
							</div>
							<!-- email -->
							<div class="form-group">
								<label for="firstname" class="col-sm-2 control-label">*邮箱</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="r_email"
										value="<%=user.getUserEmail()%>"> <span
										class="r_emailWaring" style="display: none; color: #ff0000">请输入正确的邮箱</span>
								</div>
							</div>

							<!-- address -->
							<div class="form-group">
								<label for="firstname" class="col-sm-2 control-label">*居住地址</label>
								<div class="col-sm-10">
									<select class="r_local_province">
										<option><%=user.getUserAddPro()%></option>
									</select> <select class="r_local_city">
										<option><%=user.getUserAddCity()%></option>
									</select> <select class="r_local_country">
										<option><%=user.getUserAddCou()%></option>
									</select> <input type="text" class="form-control" id="r_address"
										value="<%=user.getUserAddress()%>"> <span
										class="r_addressWaring" style="display: none; color: #ff0000">请输入详细地址</span>
								</div>
							</div>

							<div class="form-group">
								<label style="display: none" id="userId"><%=user.getUserId()%></label>
							</div>

							<div class="col-sm-offset-2 col-sm-10">
								<button type="button" class="btn btn-default"
									id="update_user_btn">确定</button>
							</div>

						</form>
					</div>

					<div class="headPart" style="display: none">
						<img alt="头像" src="../images/<%=user.getUserPhoto()%>"
							class=".img-thumbnail"> <span>原头像</span> <span id="newImg"></span>

						<form class="form-inline" role="form"
							action="../UpUInfo.do?flag=2" method="post"
							enctype="multipart/form-data">
							<div class="form-group">
								<label class="sr-only" for="inputfile">文件输入</label> <input
									type="file" id="inputfile" name="photo">
							</div>
							<div class="form-group">
								<input type="text" value="<%=user.getUserId()%>"
									style="display: none" name="id">
							</div>
							<div class="form-group">
								<button type="submit" id="sbmitBtn" disabled="disabled"
									class="btn btn-default">确定</button>
							</div>

						</form>

					</div>
					<!-- userInfo -->
				</div>
				<div class="tab-pane fade" id="ios">
					<!-- shopInfo -->
					<div class="table-responsive">
						<table class="table">
							<caption>购物记录</caption>
							<thead>
								<tr>
									<th>产品</th>
									<th>日期</th>
									<th>价格</th>
									<th>状态</th>
								</tr>
							</thead>
							<tbody class="shopInfoTb">

							</tbody>
						</table>
					</div>
					<!-- shopInfo -->
				</div>
				<div class="tab-pane fade" id="wp">
					<h1>待评价宠物</h1>
					<table class="table table-striped">
						<caption>待评价列表</caption>
						<thead>
							<tr>
								<th>编号</th>
								<th>宠物名</th>
								<th>购买时间</th>
								<th>状态</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody id="user-comms">
							<tr>
								<td>Tanmay</td>
								<td>Bangalore</td>
								<td>560001</td>
								<td>560001</td>
								<td>
									<form class="form-horizontal" role="form">
										<div class="form-group">
											<label for="firstname" class="col-sm-2 control-label">评论</label>
											<div class="col-sm-8">
											<input type="text" class="form-control" name="id" value="">
													<input type="text" class="form-control" name="flag" value="1">
												<input type="text" class="form-control" name="comment"
													placeholder="请输入评论内容">
											</div>
											   </div>
   												<div class="form-group">
											<label for="lastname" class="col-sm-2 control-label">评分</label>
											<div class="col-sm-8">
												<input type="number" class="form-control" name="grade"
													placeholder="请输入分数">
											</div>
											   </div>
   												<div class="form-group">
											<div class="col-sm-offset-2 col-sm-10">
												<input type="button" class="btn btn-default" onclick="checkComm(this)" data-user-id="" value="确定">
											</div>
										</div>
									</form>
								</td>
							</tr>

						</tbody>
					</table>
				</div>
			</div>
		</div>

	</div>

	<!-- --------------------------------------------------------中间部分结束--------------------------------------------------------------------- -->



	<!-- 复制尾部部分 -->

	<!--start-footer-->
	<div class="footer">
		<div class="container">
			<div class="footer-top">
				<div class="col-md-3 footer-left">
					<h3>关于我们</h3>
					<ul>
						<li><a href="#">了解我们</a></li>
						<li><a href="contact.html">意见建议</a></li>
						<li><a href="#">博客</a></li>
						<li><a href="#">团队</a></li>
					</ul>
				</div>
				<div class="col-md-3 footer-left">
					<h3>帐户</h3>
					<ul>
						<li><a href="account.html">您的帐户</a></li>
						<li><a href="#">个人信息</a></li>
						<li><a href="contact.html">收货地址</a></li>
						<li><a href="#">快递追踪</a></li>
					</ul>
				</div>
				<div class="col-md-3 footer-left">
					<h3>购物指南</h3>
					<ul>
						<li><a href="#">订单查询</a></li>
						<li><a href="#">配送费收取标准</a></li>
						<li><a href="#">在线自助退货</a></li>
						<li><a href="#">帮助</a></li>
					</ul>
				</div>
				<div class="col-md-3 footer-left">
					<h3>爱宠种类</h3>
					<ul>
						<li><a href="#">狗狗</a></li>
						<li><a href="#">猫咪</a></li>
						<li><a href="#">小鸟</a></li>
						<li><a href="#">鱼类</a></li>
						<li><a href="#">其它</a></li>
					</ul>
				</div>
				<div class="clearfix"></div>
			</div>
		</div>
	</div>
	<!--end-footer-->
	<!--end-footer-text-->
	<div class="footer-text">
		<div class="container">
			<div class="footer-main">
				<p class="footer-class">
					© 2015 Happy Pets All Rights Reserved | Design by <a
						href="http://fengshaohua.sinaapp.com/" target="_blank">FENG</a>
				</p>
			</div>
		</div>
		<script type="text/javascript">
			$(document).ready(function() {
				/*
				var defaults = {
					containerID: 'toTop', // fading element id
					containerHoverID: 'toTopHover', // fading element hover id
					scrollSpeed: 1200,
					easingType: 'linear' 
				};
				 */

				$().UItoTop({
					easingType : 'easeOutQuart'
				});

			});
			
		</script>
		<a href="#home" id="toTop" class="scroll" style="display: block;">
			<span id="toTopHover" style="opacity: 1;"> </span>
		</a>
	</div>
	<!--end-footer-text-->

	<div class="userId" style="display:none"><%=user.getUserId() %></div>
	

	<!-- 尾部结束 -->
	<jsp:include page="modal.html"></jsp:include>
</body>
</html>